<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
    <meta name="author" content="Coderthemes">
	
	<!-- jQuery  -->
    <script type="text/javascript" src="/plugins/jquery/jquery-3.6.0.min.js"></script>
	
	<!-- layui  -->
	<link rel="stylesheet" href="/plugins/layui/2.7.6/css/layui.css" media="all" />
	<script src="/plugins/layui/2.7.6/layui.js" charset="utf-8"></script>
	
	<!-- 基于laiui的表格 -->
	<script type="text/javascript" src="/plugins/layui/extends/sku/simple_table_choiceshop_detail.js?v=2"></script>
	<style>
	/* form表单 */
	.layuiadmin-card-header-auto{background: #fff;box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.1);}
	.layui-form-label{
		width:160px;
		padding: 6px 0px;
		margin: 0px 0px 0px -10px;
	}
	.layui-input-block{
		margin-left: 150px;
    	min-height: 30px;
	}
	.layui-input{height: 28px;}
	.margin_t0{
		margin-top: 0 !important;
	}
	.margin_r0{
		margin-right: 0 !important;
	}
	.layui-input-block input{border: 1px solid;}
	</style>
</head>
<body>

<div class="layui-tab" lay-filter="demo">
	<ul class="layui-tab-title">
		<li class="layui-this">1、基本信息</li>
		<li>2、调货信息</li>
	</ul>
	<div class="layui-tab-content">
	
		<!-- 第一步 -->
		<div class="layui-tab-item layui-show">
			<form class="layui-form" id="formId" method="post" action="/hr/choiceshop/editSetting">
				<input type="hidden" name="guid" th:value="${dto.guid}">
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>美国建议售价($)：</label>
							<div class="layui-input-block">            
								<input type="text" name="retailPriceUsa" th:value="${dto.retailPriceUsa}" autocomplete="off" placeholder="请填写建议售价($)" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>美国最低售价($)：</label>
							<div class="layui-input-block">            
								<input type="number" name="floorPriceUsa" th:value="${dto.floorPriceUsa}" autocomplete="off" placeholder="请填写最低售价要求" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>FBA配送费($)：</label>
							<div class="layui-input-block">            
								<input type="number" name="deliveryFeeUsa" th:value="${dto.deliveryFeeUsa}" autocomplete="off" placeholder="请填写最低售价要求" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>预算成本(¥)：</label>
							<div class="layui-input-block">            
								<input type="number" name="costUsa" th:value="${dto.costUsa}" autocomplete="off" placeholder="请填写预算成本(¥)" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>预算毛利率(%)：</label>
							<div class="layui-input-block">            
								<input type="number" name="grossMarginUsa" th:value="${dto.grossMarginUsa}" autocomplete="off" placeholder="请填写预算毛利率(%)" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>预估毛利润($)：</label>
							<div class="layui-input-block">            
								<input type="number" name="capitalOutoutRatioUsa" th:value="${dto.capitalOutoutRatioUsa}" autocomplete="off" placeholder="请填写投入产出比" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>英国建议售价(£)：</label>
							<div class="layui-input-block">            
								<input type="text" name="retailPriceUk" th:value="${dto.retailPriceUk}" autocomplete="off" placeholder="请填写建议售价($)" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>英国最低售价(£)：</label>
							<div class="layui-input-block">            
								<input type="number" name="floorPriceUk" th:value="${dto.floorPriceUk}" autocomplete="off" placeholder="请填写最低售价要求" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>FBA配送费(£)：</label>
							<div class="layui-input-block">            
								<input type="number" name="deliveryFeeUk" th:value="${dto.deliveryFeeUk}" autocomplete="off" placeholder="请填写最低售价要求" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>预算成本(¥)：</label>
							<div class="layui-input-block">            
								<input type="number" name="costUk" th:value="${dto.costUk}" autocomplete="off" placeholder="请填写预算成本" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>预算毛利率(%)：</label>
							<div class="layui-input-block">            
								<input type="number" name="grossMarginUk" th:value="${dto.grossMarginUk}" autocomplete="off" placeholder="请填写预算毛利率" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label"><font style="color: red;">*</font>预估毛利润(£)：</label>
							<div class="layui-input-block">            
								<input type="number" name="capitalOutoutRatioUk" th:value="${dto.capitalOutoutRatioUk}" autocomplete="off" placeholder="请填写投入产出比" class="layui-input" lay-verify="required">
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label">商品尺寸：</label>
							<div class="layui-input-block">            
								<input type="text" name="sizePackage" th:value="${dto.sizePackage}" autocomplete="off" placeholder="请输入" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label">商品重量：</label>
							<div class="layui-input-block">            
								<input type="text" name="weightPackage" th:value="${dto.weightPackage}" autocomplete="off" placeholder="请输入" class="layui-input">
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs12 margin_r0">
						<div>
							<label class="layui-form-label">商品竞争优势：</label>
							<div class="layui-input-block">
								<textarea rows="5" cols="5" name="advantage" th:text="${dto.advantage}" autocomplete="off" placeholder="请输入" class="layui-textarea"></textarea>
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline layui-col-xs4 margin_r0">
						<div>
							<label class="layui-form-label">备注：</label>
							<div class="layui-input-block">            
								<input type="text" name="remark" th:value="${dto.remark}" autocomplete="off" placeholder="请输入" class="layui-input">
							</div>
						</div>
					</div>
				</div>
			
				<div class="layui-form-item" pane="">
					<label class="layui-form-label">商品标签：</label>
					<div class="layui-input-block">
						<input type="radio" name="vType" th:each="vType: ${dto.vTypeArr}" th:value="${vType.value}" th:title="${vType.name}" lay-skin="primary" lay-filter="vType" th:checked="${vType.isSelected()}">
					</div>
				</div>
				
		
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"></fieldset>
				<div class="layui-form-item">
					<div class="layui-col-md1 layui-col-md-offset11">
						<div class="layui-btn-container">
							<button type="button" class="layui-btn" lay-submit lay-filter="formSubmit">保存</button>
						</div>
					</div>
				</div>
			</form>
		</div>
	
		<!-- 第二步 -->
		<div class="layui-tab-item">
			<form class="layui-form" id="formId" method="post" action="/hr/choiceshop/editDetailBatch">
				<input type="hidden" name="pcode" th:value="${dto.code}">
				<div style="width:100%; overflow:scroll">
					<div id="simple_table_choiceshop_detail">
					</div>
				</div>
				<script th:inline="javascript">
				var tableOfChoiceshopDetail = null;
				//使用layui的sku模块
				layui.use(['form', 'simple_table_choiceshop_detail', 'jquery'], function(){
					var $ = layui.jquery,simple_table_choiceshop_detail = layui.simple_table_choiceshop_detail,form = layui.form;
		           	
					tableOfChoiceshopDetail = simple_table_choiceshop_detail.init({ id:'simple_table_choiceshop_detail', data: $.parseJSON(JSON.stringify([[${dto.detailArr}]])), pcode:[[${dto.code}]]  });
				});
				</script>
				
		
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"></fieldset>
				<div class="layui-form-item">
					<div class="layui-col-md1 layui-col-md-offset11">
						<div class="layui-btn-container">
							<button type="button" class="layui-btn" lay-submit lay-filter="formSubmit2">保存调货信息</button>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
	<script>
	$(function () {
		layui.use(['element', 'form'], function(){
			var element = layui.element,
				form = layui.form;
			
			// 表单提交，共用同一个
			form.on('submit(formSubmit)', function(data){
				var indexOfLoading = layer.load(1, {
					shade: [0.5,'#000000'] //0.1透明度的白色背景
				});
				$.post(data.form.action, data.field, function(res){
					if (res.code == 0) {
						layer.msg(res.msg);
						setTimeout(function(){
							layer.close(indexOfLoading);
							//window.parent.location.reload();
						}, 1000);
					} else {
						layer.close(indexOfLoading);
						layer.msg(res.msg);
					}
				});
				return false;
			});
			
			// 表单提交，共用同一个
			form.on('submit(formSubmit2)', function(data){
				var indexOfLoading = layer.load(1, {
					shade: [0.5,'#000000'] //0.1透明度的白色背景
				});
				data.field['detailArr'] = JSON.stringify(tableOfChoiceshopDetail.getData());
				$.post(data.form.action, data.field, function(res){
					if (res.code == 0) {
						layer.msg(res.msg);
						setTimeout(function(){
							layer.close(indexOfLoading);
						}, 1000);
					} else {
						layer.close(indexOfLoading);
						layer.msg(res.msg);
					}
				});
				return false;
			});
		});
	});
	</script>

</body>
</html>
